package sim;

import org.magnos.steer.Vector;
import org.magnos.steer.spatial.SpatialEntity;

import ui.Grafikobjekt;
import animal.Lauftier;

public class AntSimEntity implements SpatialEntity{
	private Vector pos;
	private Grafikobjekt ref;
	private long group;
	private boolean inert = false;
	public AntSimEntity(float x,float y,Grafikobjekt ref,long group){
		pos = new Vector(x,y);
		this.ref = ref;
		this.group = group;
	}
	
	public void update(){
		pos = new Vector((float)ref.getX(),(float)ref.getY());	
		inert = !((Lauftier)ref).getLebensZustand();	
	}
	
	@Override
	public Vector getPosition() {
		return pos;
	}

	@Override
	public float getRadius() {
		return 1;
	}

	@Override
	public long getSpatialGroups() {
		// TODO Auto-generated method stub
		return group;
	}

	@Override
	public long getSpatialCollisionGroups() {
		// TODO Auto-generated method stub
		return group;
	}

	@Override
	public boolean isStatic() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isInert() {		
		return inert;
	}
	
	public Grafikobjekt getRef(){
		return this.ref;
	}
	
	public String toString(){
		return "("+pos.x+","+pos.y+")=>"+ref;
	}
	
}